package com.hit.aircraftwar.creator;

import com.hit.aircraftwar.activity.MainActivity;
import com.hit.aircraftwar.aircraft.EliteEnemy;
import com.hit.aircraftwar.application.ImageManager;
import com.hit.aircraftwar.setter.ParameterSet;
import com.hit.aircraftwar.strategy.ShootStrategy;
import com.hit.aircraftwar.strategy.StraightShootStrategy;

/**
 * @author LiuYuZhe
 */
public class EliteEnemyCreator implements Creator {

    /**
     * 精英默认基础参数
     */
    private final int SpeedY = 4;
    private final ShootStrategy shootStrategy = new StraightShootStrategy();
    private final int direction = 1;
    private final int shootNum = 1;

    @Override
    public EliteEnemy creatObject(int locationX, int locationY) {
        return new EliteEnemy(
                locationX,
                locationY,
                ParameterSet.getInstance().getEliteSpeedX(),
                this.SpeedY,
                ParameterSet.getInstance().getEliteHp(),
                this.shootStrategy,
                this.direction,
                ParameterSet.getInstance().getElitePower(),
                this.shootNum
        );
    }

    @Override
    public EliteEnemy creatObject() {
        return new EliteEnemy(
                (int) (Math.random() * (MainActivity.width - ImageManager.getWidth(ImageManager.ELITE_ENEMY_IMAGE))),
                0,
                ParameterSet.getInstance().getEliteSpeedX(),
                this.SpeedY,
                ParameterSet.getInstance().getEliteHp(),
                this.shootStrategy,
                this.direction,
                ParameterSet.getInstance().getElitePower(),
                this.shootNum
        );
    }
}
